#include <iostream>
#include <string.h>
// 学生节点
struct student_node
{
    // 初始化结构体函数
    student_node(const char *n, int i, int a, student_node *ne)
    {
        strcpy(name, n);
        id = i;
        age = a;
        next = ne;
    }

    char name[50];
    int id;
    int age;
    struct student_node *next;
};

int main()
{
    // 新建节点 student_node("小明", 123, 18, NULL) 调用 student_node(const char *n, int i, int a, student_node *ne)
    student_node *p = new student_node("小明", 123, 18, NULL);
#if 0
    // 新建节点
    struct student_node *p = new struct student_node;

    // 初始化节点
    // p->name = "小明";
    strcpy(p->name, "小明");
    p->id = 123;
    p->age = 18;
    p->next = NULL;
#endif
    std::cout << p->name << std::endl;
    std::cout << p->id << std::endl;
    std::cout << p->age << std::endl;

    return 0;
}